package com.xingdian.xingdianhulianweb.common;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

@Setter
@Getter
public class QueryObject {
    private int currentPage = 1;
    private int pageSize = 6;
    private String keyword;
    private Integer brandTypeId;
    private int receiveOrderStatus=5;
    private int dinnerOrderStatus=5;
    private String type;
    private String status;
    private String shopId;
    private String categoryId;
    private String loginState;

    @Override
    public String toString() {
        return "QueryObject{" +
                "currentPage=" + currentPage +
                ",pageSize=" + pageSize +
                ",type=" + type +
                ",status=" + status +
                ", shopId=" + shopId +
                ", categoryId=" + categoryId +
                ", loginState=" + loginState +
                ", keyword='" + keyword + '\'' +
                '}';
    }

    public Integer getBrandTypeId() {
        return brandTypeId;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public int getReceiveOrderStatus() {
        return receiveOrderStatus;
    }

    public int getDinnerOrderStatus() {
        return dinnerOrderStatus;
    }

    public int getPageSize() {
        return pageSize;
    }
    public String getShopId(){
        return StringUtils.isEmpty(shopId)? null : shopId;
    }
    public String getType(){
        return StringUtils.isEmpty(type)? null : type;
    }
    public String getStatus(){
        return StringUtils.isEmpty(status)? null : status;
    }
    public String getCategoryId(){
        return StringUtils.isEmpty(categoryId)? null : categoryId;
    }
    public String getKeyword(){
        return StringUtils.isEmpty(keyword)? null : keyword;
    }
    public String getLoginState(){
        return StringUtils.isEmpty(loginState)? null : loginState;
    }
    public int getStartIndex(){
        return pageSize * (currentPage - 1);
    }
}
